package com.yxc.plan.wolf.exception;

import org.springframework.validation.FieldError;

import java.util.List;

/**
 * @Description :
 * @Author : abc@vanke.com
 * @Date : 2018/12/10 5:44 PM
 */
public class HttpStatusRuntimeException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private int code;
    private String message;
    private List<FieldError> details;

    public HttpStatusRuntimeException(int code, String message, List<FieldError> details) {
        super();
        this.code = code;
        this.message = message;
        this.details = details;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<FieldError> getDetails() {
        return details;
    }

    public void setDetails(List<FieldError> details) {
        this.details = details;
    }

    @Override
    public String toString() {
        return "CommonHttpException [code=" + code + ", message=" + message + ", details=" + details + "]";
    }

}
